import 'package:flutter/material.dart';
import 'package:enterprise_v8/app/components/toast_widget.dart';

/// 视频播放器
/// 基于原生的ijkplayer播放器(原皮版)
/// demo:
/// ```dart
/// IjkPlayerPage(
///   url: '',
/// )
/// ```
class IjkPlayerPage extends StatefulWidget {
  const IjkPlayerPage({required this.url, super.key});

  final String url;

  @override
  State<IjkPlayerPage> createState() => _IjkPlayerPageState();
}

class _IjkPlayerPageState extends State<IjkPlayerPage> {
  // final FijkPlayer player = FijkPlayer();

  @override
  void initState() {
    super.initState();
    // if (widget.url.isNotEmpty && widget.url != '') {
    //   player.setDataSource(widget.url, autoPlay: true);
    // } else {
    //   AppToast.showError('视频地址为空');
    // }
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      // body: FijkView(
      //   color: Colors.black,
      //   player: player,
      // ),
    );
  }

  @override
  void dispose() {
    // player.release();
    super.dispose();
  }

}
